home *** CD-ROM | disk | FTP | other *** search
- Path: gaia.ns.utk.edu!mbk
- From: mbk@caffeine.engr.utk.edu (Matt Kennel)
- Newsgroups: comp.lang.c++
- Subject: Re: Will JAVA kill C++?
- Date: 26 Mar 1996 21:00:28 GMT
- Organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory
- Message-ID: <4j9ltc$h2n@gaia.ns.utk.edu>
- References: <313E44EA.14D110C0@netcom.com> <4hp18v$3di@frodo.smartlink.net> <4ht8k1$t7l@epx.cis.umn.edu> <3146278D.7703E9CC@netcom.com> <4i6q13$4e8@gaia.ns.utk.edu> <4j9gf5$e01@druid.borland.com>
- Reply-To: kennel@msr.epm.ornl.gov
- NNTP-Posting-Host: caffeine.engr.utk.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Pete Becker (pete@borland.com) wrote:
- : In article <4i6q13$4e8@gaia.ns.utk.edu>, mbk@caffeine.engr.utk.edu says...
- : >
- : >Adam Megacz (kalessin@netcom.com) wrote:
- : >: Olivier Meirhaeghe wrote:
- : >
- : >: > whoever wants speed should stick to C or Fortran, not C++. Heavy graphics
- : >: I'm not a Fortran buff, but I don't understand why C is faster than C++.
- : >: C++ supports all C features (except the void* crap). If anything, C++'s
- : >: type-checking allows more compiler optimizations, making it a slightly
- : >: faster language.
- : >
- : >C is not faster than C++ if you use C++ as plain C compiler.
- : >
- : >If you want to use features of C++ that theoretically ought to seem
- : >good for numerical programming, such as complex number classes and
- : >especially matrix classes, various language consequences of C++ combine
- : >to make things slower than they should be with nearly all compilers if you
- : >want to use idiomatic matrix classes.
-
- : It turns out that this isn't necessarily true. There was a paper
- : presented by David Vandevoorde at the latest ANSI/ISO C++ meeting about
- : implementing the valarray template in a way that permitted aggressive
- : optimizations. With his changes, expressions like sum(1.2*x-2.3*y+3.4); can be
- : compiled into code that runs just as fast as the corresponding C code with
- : explicit loops, plus a bit of setup time. That's with straight gcc, not a
- : compiler that's specifically optimized for valarray.
- : Basically, the technique is to implement valarray in such a way that
- : arithmetic operations on valarrays build a parse tree rather than performing
- : the actual operation.
-
- That is an interesting virtuoso solution for some problems.
-
- But it wouldn't help somebody programming say inner loops of the singular
- value decomposition or other algorithms whose operations were not
- simple algebraic functions of other matrices.
-
- : -- Pete
-
-